package com.ruoyi.gas.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.gas.mapper.GasCompanyDeviceMapper;
import com.ruoyi.gas.domain.GasCompanyDevice;
import com.ruoyi.gas.service.IGasCompanyDeviceService;

/**
 * 企业设备关系Service业务层处理
 *
 * @author ruoyi
 * @date 2024-01-18
 */
@Service
public class GasCompanyDeviceServiceImpl implements IGasCompanyDeviceService
{
    @Autowired
    private GasCompanyDeviceMapper gasCompanyDeviceMapper;

    /**
     * 查询企业设备关系
     *
     * @param id 企业设备关系主键
     * @return 企业设备关系
     */
    @Override
    public GasCompanyDevice selectGasCompanyDeviceById(Long id)
    {
        return gasCompanyDeviceMapper.selectGasCompanyDeviceById(id);
    }

    /**
     * 查询企业设备关系列表
     *
     * @param gasCompanyDevice 企业设备关系
     * @return 企业设备关系
     */
    @Override
    public List<GasCompanyDevice> selectGasCompanyDeviceList(GasCompanyDevice gasCompanyDevice)
    {
        return gasCompanyDeviceMapper.selectGasCompanyDeviceList(gasCompanyDevice);
    }

    /**
     * 新增企业设备关系
     *
     * @param gasCompanyDevice 企业设备关系
     * @return 结果
     */
    @Override
    public int insertGasCompanyDevice(GasCompanyDevice gasCompanyDevice)
    {
        gasCompanyDevice.setCreateTime(DateUtils.getNowDate());
        return gasCompanyDeviceMapper.insertGasCompanyDevice(gasCompanyDevice);
    }

    /**
     * 修改企业设备关系
     *
     * @param gasCompanyDevice 企业设备关系
     * @return 结果
     */
    @Override
    public int updateGasCompanyDevice(GasCompanyDevice gasCompanyDevice)
    {
        gasCompanyDevice.setUpdateTime(DateUtils.getNowDate());
        return gasCompanyDeviceMapper.updateGasCompanyDevice(gasCompanyDevice);
    }

    /**
     * 批量删除企业设备关系
     *
     * @param ids 需要删除的企业设备关系主键
     * @return 结果
     */
    @Override
    public int deleteGasCompanyDeviceByIds(Long[] ids)
    {
        return gasCompanyDeviceMapper.deleteGasCompanyDeviceByIds(ids);
    }

    /**
     * 删除企业设备关系信息
     *
     * @param id 企业设备关系主键
     * @return 结果
     */
    @Override
    public int deleteGasCompanyDeviceById(Long id)
    {
        return gasCompanyDeviceMapper.deleteGasCompanyDeviceById(id);
    }
}
